//
//  WQCityTableVc1.m
//  快医
//
//  Created by 张德华 on 7/6/16.
//
//

#import "WQCityTableVc1.h"
#import "XHRTopView.h"
#import "XHRHomeViewController.h"

@interface WQCityTableVc1 ()

@end

@implementation WQCityTableVc1

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"选择当前城市位置";
    
    [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cityCell1"];
    
}

#pragma mark
#pragma mark - 数据源代理dataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return self.cityArray.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cityCell1" forIndexPath:indexPath];
    if(!cell){
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cityCell1"];
        NSLog(@"cell1");
    }
    
    cell.textLabel.text = self.cityArray[indexPath.row];
    
    return cell;
}

#pragma mark
#pragma mark - delete
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    NSString *localStr = self.cityArray[indexPath.row];

    XHRHomeViewController *homeVc = self.navigationController.childViewControllers.firstObject;
    homeVc.localStr = localStr;
    
    [self.navigationController popToRootViewControllerAnimated:YES];
}














@end
